//# sourceURL=http://uMapApp/Module/LayerModule
define([
    "mhjs/mhjs",
    "uMap/uMap",
    "uEarth/uEarth",
    "./Module",
    "../UI/Panel/FloatPanel",
    "../UI/Panel/PanelBlock/TreeBlock"
], function (
    mhjs,
    uMap,
    uEarth,
    Module,
    FloatPanel,
    TreeBlock
) {

    function LayerModule(option) {

        var _this = this;

        _this.title = "图层管理";

        _this.layerPanel = new FloatPanel({"class": "leftPanel"});
        _this.layerPanel.treeBlock = new TreeBlock({"class": "fullBlock"});
        _this.layerPanel.append(_this.layerPanel.treeBlock);
        _this.layerPanel.treeBlock.title = _this.title;

        Module.call(_this, option);
        _this.app.ui.layout.left.append(_this.layerPanel);

    }

    var _class = LayerModule;

    mhjs.Inherit(_class, Module);

    Object.defineProperties(_class.prototype, {
        "open"  : {
            value: function () {
                var _this = this;
                _this.layerPanel.open();
                _this.isOpened = true;
            }
        },
        "close" : {
            value: function () {
                var _this = this;
                _this.layerPanel.close();
                _this.isOpened = false;
            }
        },
        "toggle": {
            value: function () {
                var _this = this;
                if (_this.isOpened) {
                    _this.close();
                } else {
                    _this.open();
                }
            }
        }
    });

    return _class;

});